﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace exerciseFour
{
    class Program
    {
        static void Main(string[] args)
        {
            double PI=0;
            int i=1;
            do
            {
                if (((i-1)/2)%2==1)
                {
                    PI -= 4 * (1 / (float)i);
                }
                PI += 4 * (1 /(float) i);
                i+=2;
            } while (1/(float)i>0.000001);
            Console.WriteLine(PI);
            Console.ReadKey();
        }
    }
}
